import { configureStore } from '@reduxjs/toolkit';
import languageReducer from './slices/languageSlice';
import countryReducer from './slices/countrySlice';
import deviceReducer from './slices/deviceSlice';
import fullSceneReducer from './slices/fullSceneSlice';
import landscapeColorsReducer from './slices/landscapeColorsSlice';
import globalReducer from './slices/globalSlice';

// 配置store
export const store = configureStore({
  reducer: {
    language: languageReducer,
    country: countryReducer,
    device: deviceReducer,
    landscapeColors: landscapeColorsReducer,
    fullScene: fullSceneReducer,
    global: globalReducer,
  },
  middleware: (getDefaultMiddleware) => 
    getDefaultMiddleware({
      serializableCheck: false,
    }),
  enhancers: (getDefaultEnhancers) => {
    const enhancers = getDefaultEnhancers();
    // // 仅在开发环境中使用Reactotron
    // if (__DEV__ && Reactotron.createEnhancer) {
    //   enhancers.push(Reactotron.createEnhancer());
    // }
    return enhancers;
  },
});

export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;

export default store; 